﻿/*
 * @Autor: PK
 * @Date: 2020-12-24 10:08:47
 * @Description: 路网
 */


using System;
using ShkSimulation.core.template.customer;
using ShkSimulation.core.template.model;

namespace ShkSimulation.core.template {
	
	public interface CloneableNetwork: Network {
	
		public CloneableNetwork CloneOrCreate(int id, string name,
			NetworkInputData inputData = null,
			NetworkResultCollector resultCollector = null,
			DemandManager demandManager = null, int seed = 0);

	}

	public interface Network: SimulationResultReporter, InitAndDispose{

	    public int UniqueId { get;  }
	    
	    public NetworkResultCollector ResultCollector { get; }
	    
	    public NetworkInputData NetworkInput { get; }
	    
	    public DateTime NetworkCurrentTime { get; }
	    
	    public DateTime NetworkStartTime { get; }
	    
	    public bool Cancel { get; set; }

	    public bool RunWithTerminate(DateTime terminate, TimeSpan observeSpan);

	    public bool RunWithTerminate(TimeSpan runTime, TimeSpan observeSpan);
	    
	    public bool ContinousRun(TimeSpan totalRunTime, TimeSpan observeSpan);
	    
        public NetworkRunInfo Init(DateTime startTime);

        public NetworkRunInfo Init() {
	        return Init(DateTime.MinValue);
        }

        public event Action<NetworkRunInfo> BeforeInit;
        
        public event Action<NetworkRunInfo> AfterInitFailed;

        public event Action<NetworkRunInfo> AfterInitSuccess;
        
        public event Action<NetworkRunInfo> BeforeSimulationRun;

        public event Action<NetworkRunInfo> OnSimulationRunning;

        public event Action<NetworkRunInfo> AfterRunCompleted;

        public event Action<NetworkRunInfo> AfterRunCanceled;

    }


}
